package demo01;

public class java_07 {
	public static void main(String[] args) {
	    Printer printer = new Printer();
	    Thread thread1 = new Thread(() -> {
	            try {
	                printer.printnumbers();
	            } catch (InterruptedException e) {
	                e.printStackTrace();
	            }
	        });

	        Thread thread2 = new Thread(() -> {
	            try {
	                printer.printLetters();
	            } catch (InterruptedException e) {
	            	e.printStackTrace();
	            }
	        });

	        thread1.start();
	        thread2.start();

	        try {
	            thread1.join();
	            thread2.join();
	        } catch (InterruptedException e) {
	            Thread.currentThread().interrupt();
	        }
	    }
}
